<?php
  $uri_segment = $this->uri->segment(3);
  if($uri_segment != "" && $uri_segment != "all"){
      $option = parsing_param2($uri_segment);
      $awal = datefmysql($option['awal']);
      $akhir = datefmysql($option['akhir']);
  }else{
      $awal = date('d/m/Y');
      $akhir = date('d/m/Y');
  }
?>
<html>
    <head>
        <title>Cetak Laporan Pemasukan</title>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/style2.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/tabel.css" />
        <script type="text/javascript">
                function cetak() {
                        SCETAK.innerHTML = '';
                        window.print();
                        if (confirm('Apakah menu print ini akan ditutup?')) {
                                window.close();
                        }
                        SCETAK.innerHTML = '<br /><input onClick=\'cetak()\' type=\'submit\' name=\'Submit\' value=\'Cetak\' class=\'tombol\'>';
                }

        </script>
    </head>
    <body>
      <center>
          <h1>Laporan Pemasukan</h1>
          <h2>Periode <?php echo indo_tgl($awal)?> s.d <?php echo indo_tgl($akhir)?></h2>
      </center>  
    <div class="data-list">
        <table class="tabel" style="width: 100%">
            <tr>
                <th>No</th>
                <th>Petugas</th>
                <th>Tanggal</th>
                <th>Jumlah (Rp.)</th>
                <th>Keterangan</th>
            </tr>
            <?php
              $offsets = isset ($offset)?$offset:0;
              $no = 1 + $offsets;
              foreach ($listPemasukan as $row){
            ?>
            <tr class="<?php echo ($no%2)?"even":"odd";?>">
                <td style="text-align: center;width: 5%"><?php echo $no++;?></td>
                <td style="width:20%;"><?php echo $row['petugas'];?></td>
                <td style="width:20%;"><?php echo datefmysql($row['tanggal']);?></td>
                <td style="text-align: right;width:20%;"><?php echo rupiah($row['jumlah']);?></td>
                <td><?php echo $row['keterangan'];?></td>
            </tr>
            <?php
              }
            ?>
        </table>
    </div>
    <center><span id="SCETAK"><input type="button" class="tombol" value="Cetak" onClick="cetak()"/></span></center>
    </body>
</html>    